module.exports = function(){
	switch(process.env.NODE_ENV){
        case 'test':
            return {
							"debug": true
							,"host": "localhost" || process.env.AUTHUB_HOST_NAME /* the root host name, should be a domain name or IP address */
							,"mongodb": {
								conn: process.env.AUTHUB_MONGO_URI || 'mongodb://localhost/auth_hub'
							}
            	,"log4js": {
		             "appenders": [
		                { "type": "console" },
		                {
		                    "type": "file",
		                    "filename": "logs/server.log",
		                    "maxLogSize": 20480,
		                    "backups": 3
		                }
		            ],
		            replaceConsole: false
		        }
		        , express: {
		        	trustProxy: true
		        }
          };
        case 'production':
            return {
            	"log4js": {
		             "appenders": [
		                {
		                    "type": "file",
		                    "filename": "logs/server.log",
		                    "maxLogSize": 20480,
		                    "backups": 3,
		                    "category": "*"
		                }
		            ]

		        }
		        , express: {
		        	trustProxy: true
		        }
		    };

        default: //development
            return {
							"debug": true
							,"host": process.env.AUTHUB_HOST_NAME || "localhost"  /* the root host name, should be a domain name or IP address */
							,"mongodb": {
								conn: process.env.AUTHUB_MONGO_URI || 'mongodb://localhost/auth_hub'
							}
            	,"log4js": {
		             "appenders": [
		                { "type": "console" },
		                {
		                    "type": "file",
		                    "filename": "logs/server.log",
		                    "maxLogSize": 20480,
		                    "backups": 3
		                }
		            ],
		            replaceConsole: false
		        }
						,cookie: {	//cookie configuration options, please ref: https://www.npmjs.com/package/cookie-encryption
								maxAge: 7200
								, secure: false
								, cipher: 'aes-256-cbc'
								, encoding: 'base64'
								, httpOnly: false
								, signed: true
						}
		        , express: {
		        	trustProxy: false
		        }
          };
    }
}
